-- @owner: @nanyang12
-- @date: 2024/10/23
-- @testpoint:connectby中使用nocycle+siblings

--step1:建表并插入数据
drop table if exists t_dql_connect_by_0034;
create table t_dql_connect_by_0034(id int, lid int, name text);
insert into t_dql_connect_by_0034 values (1,3,'A'),(2,1,'B'),(3,2,'C'),(4,2,'D'), (5,3,'E');
--step2:connectby中使用nocycle+siblings
select *,connect_by_iscycle from t_dql_connect_by_0034 connect by nocycle prior id=lid start with id=1 order siblings by id;
--step3:清理环境
drop table if exists t_dql_connect_by_0034;
